package com.mwj.gulimall.prodict.feign;

import com.mwj.common.to.SpuBoundTo;
import com.mwj.common.to.SpuReductionTo;
import com.mwj.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("gulimall-coupon")
public interface CouponFeignService {

    /*
      CouponFeignService.saveSpuBounds(spuBoundTo)
      1.@RequerstBody将对象转成json
      2.找到gulimall-coupon服务给/coupon/spubounds/save发送请求，
      将上一步的json放在请求体位置，发送请求
      3.对方服务接收到请求，请求里面有json数据
      （RequestBody，SpuBoundsEntity,spuBounds）；将请求体转为jsonSpuBoundsEntity
      只要json数据模型是兼容的双方五福无线使用同意to
     */
    @PostMapping("/coupon/spubounds/save")
    R saveSpuBounds(@RequestBody SpuBoundTo spuBoundTo);
    @PostMapping("/coupon/skufullreduction/saveIfon")
    R saveSkuReduction(@RequestBody SpuReductionTo spuReductionTo);
}
